<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>1.天气案例</title>
		<!-- 引入Vue -->
		<script type="text/javascript" src="../js/vue.js"></script>
	</head>
	<body>
		<!-- 准备好一个容器-->
		<div id="demo">
			<h2>今天天气很{{text}}</h2>
			<button @click="isHot = !isHot">切换天气</button>
		</div>

		<script type="text/javascript">
			new Vue({
				el:'#demo',
				data:{
					isHot:true,
				},
				computed:{
					text(){
						return this.isHot ? '炎热' : '凉爽'
					}
				},
				/* methods:{
					changeWeather(){
						this.isHot = !this.isHot
					}
				} */
			})
		</script>
	</body>
</html>